<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: Vertx::SharedData
  
    &mdash; Ruby API Doc
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (S)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../Vertx.html" title="Vertx (module)">Vertx</a></span></span>
     &raquo; 
    <span class="title">SharedData</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: Vertx::SharedData
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Vertx::SharedData</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">src/main/api_shim/core/shared_data.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    Sometimes it is desirable to share immutable data between different event loops, for example to implement a
cache of data.

This class allows data structures to be looked up and used from different event loops.
The data structures themselves will only allow certain data types to be stored into them. This shields the
user from worrying about any thread safety issues might occur if mutable objects were shared between event loops.

The following types can be stored in a shareddata data structure:

  String
  FixNum
  Float
  <span class='object_link'><a href="Buffer.html" title="Vertx::Buffer (class)">Buffer</a></span> this will be automatically copied, and the copy will be stored in the structure.

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Author:</p>
<ul class="author">
  
    <li>
      
      
      
      
        
        <div class='inline'><a href="http://tfox.org" target="_parent" title="Tim Fox">Tim Fox</a></div>
      
    </li>
  
</ul>

</div>
  <h2>Constant Summary</h2>
  
    <dl class="constants">
      
        <dt id="j_sd-classvariable" class="">@@j_sd =
          
        </dt>
        <dd><pre class="code"><span class='rubyid_org identifier id'>org</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_java identifier id'>java</span><span class='dot token'>.</span><span class='rubyid_platform identifier id'>platform</span><span class='dot token'>.</span><span class='rubyid_impl identifier id'>impl</span><span class='dot token'>.</span><span class='rubyid_JRubyVerticleFactory constant id'>JRubyVerticleFactory</span><span class='dot token'>.</span><span class='rubyid_vertx identifier id'>vertx</span><span class='dot token'>.</span><span class='rubyid_sharedData identifier id'>sharedData</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
</pre></dd>
      
    </dl>
  







  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_hash-class_method" title="get_hash (class method)">+ (Hash) <strong>get_hash</strong>(key) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>Return a Hash with the specific name.</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_set-class_method" title="get_set (class method)">+ (SharedSet) <strong>get_set</strong>(key) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>Return a Set with the specific name.</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#remove_hash-class_method" title="remove_hash (class method)">+ (Object) <strong>remove_hash</strong>(key) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>Remove the hash.</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#remove_set-class_method" title="remove_set (class method)">+ (Object) <strong>remove_set</strong>(key) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>Remove the set.</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#%3D%3D-instance_method" title="#== (instance method)">- (Object) <strong>==</strong>(other) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#_to_java_map-instance_method" title="#_to_java_map (instance method)">- (Object) <strong>_to_java_map</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="get_hash-class_method">
  
    + (<tt>Hash</tt>) <strong>get_hash</strong>(key) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    Return a Hash with the specific name. All invocations of this method with the same value of name
are guaranteed to return the same Hash instance.

  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>key.</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>Get the hash with the key.</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Hash</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>the hash.</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


42
43
44
45</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 42</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_SharedData constant id'>SharedData</span><span class='dot token'>.</span><span class='rubyid_get_hash identifier id'>get_hash</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_map identifier id'>map</span> <span class='assign token'>=</span> <span class='rubyid_@@j_sd ivar id'>@@j_sd</span><span class='dot token'>.</span><span class='rubyid_getMap identifier id'>getMap</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_SharedHash constant id'>SharedHash</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_map identifier id'>map</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="get_set-class_method">
  
    + (<tt><span class='object_link'>SharedSet</span></tt>) <strong>get_set</strong>(key) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    Return a Set with the specific name. All invocations of this method with the same value of name
are guaranteed to return the same Set instance.

  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>key.</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>Get the set with the key.</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'>SharedSet</span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>the set.</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


51
52
53
54</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 51</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_SharedData constant id'>SharedData</span><span class='dot token'>.</span><span class='rubyid_get_set identifier id'>get_set</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_set identifier id'>set</span> <span class='assign token'>=</span> <span class='rubyid_@@j_sd ivar id'>@@j_sd</span><span class='dot token'>.</span><span class='rubyid_getSet identifier id'>getSet</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_SharedSet constant id'>SharedSet</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_set identifier id'>set</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="remove_hash-class_method">
  
    + (<tt>Object</tt>) <strong>remove_hash</strong>(key) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    Remove the hash

  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>key.</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>The key of the hash.</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


58
59
60</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 58</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_SharedData constant id'>SharedData</span><span class='dot token'>.</span><span class='rubyid_remove_hash identifier id'>remove_hash</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_@@j_sd ivar id'>@@j_sd</span><span class='dot token'>.</span><span class='rubyid_removeMap identifier id'>removeMap</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="remove_set-class_method">
  
    + (<tt>Object</tt>) <strong>remove_set</strong>(key) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    Remove the set

  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>key.</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>The key of the set.</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 64</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_SharedData constant id'>SharedData</span><span class='dot token'>.</span><span class='rubyid_remove_set identifier id'>remove_set</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
  <span class='rubyid_@@j_sd ivar id'>@@j_sd</span><span class='dot token'>.</span><span class='rubyid_removeSet identifier id'>removeSet</span><span class='lparen token'>(</span><span class='rubyid_key identifier id'>key</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="==-instance_method">
  
    - (<tt>Object</tt>) <strong>==</strong>(other) 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


102
103
104
105
106
107
108</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 102</span>

<span class='rubyid_def def kw'>def</span> <span class='eq op'>==</span><span class='lparen token'>(</span><span class='rubyid_other identifier id'>other</span><span class='rparen token'>)</span>
  <span class='rubyid_if if kw'>if</span> <span class='rubyid_other identifier id'>other</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='rubyid_SharedHash constant id'>SharedHash</span><span class='rparen token'>)</span>
    <span class='rubyid_@hash ivar id'>@hash</span><span class='dot token'>.</span><span class='rubyid_equal? fid id'>equal?</span><span class='lparen token'>(</span><span class='rubyid_other identifier id'>other</span><span class='dot token'>.</span><span class='rubyid__to_java_map identifier id'>_to_java_map</span><span class='rparen token'>)</span>
  <span class='rubyid_else else kw'>else</span>
    <span class='rubyid_false false kw'>false</span>
  <span class='rubyid_end end kw'>end</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="_to_java_map-instance_method">
  
    - (<tt>Object</tt>) <strong>_to_java_map</strong> 
  

  

  
</h3><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


110
111
112</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'src/main/api_shim/core/shared_data.rb', line 110</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid__to_java_map identifier id'>_to_java_map</span>
  <span class='rubyid_@hash ivar id'>@hash</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Wed Jul 17 20:30:37 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.6.1 (ruby-1.9.3).
</div>

  </body>
</html>